﻿using UnityEngine;
using System.Collections;

public class GotoArena : MonoBehaviour {

	public GameObject prefab;

	void OnClick ()
	{
		GameObject contraption = GameObject.FindGameObjectWithTag ("Contraption");
		GameObject go = Instantiate(prefab, new Vector3 (0,0,0), Quaternion.identity) as GameObject; 
		contraption.transform.parent = go.transform;

		DontDestroyOnLoad (go);  //keep contraption

		Destroy(GameObject.FindGameObjectWithTag ("Cube Frame"));  //destroy frame

		Application.LoadLevel (1);
	}
}
